package com.cipta.lomob.adapter;

import com.cipta.lomob.R;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class NotificationAdapter extends BaseAdapter{
	
	Activity activity;
	LayoutInflater inflater;
	
	public NotificationAdapter(Activity activity) {
		// TODO Auto-generated constructor stub
		this.activity = activity;
		inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 10;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		View view = arg1;
		ViewHolder holder = null;
		
		if (view == null) {
			holder = new ViewHolder();
			view = inflater.inflate(R.layout.inf_item_notification, null);
			holder.txtTime = (TextView)view.findViewById(R.id.txt_inf_item_notification_time);
			holder.txtTitle = (TextView)view.findViewById(R.id.txt_inf_item_notification_title);
			view.setTag(holder);
		} else {
			holder = (ViewHolder)view.getTag();
		}
		
		return view;
	}
	
	static class ViewHolder{
		ImageView imgAvatar;
		TextView txtTitle, txtTime;
	}
	
}
